home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Environments / Clean 1.2.4 / IOInterface / scrollList.dcl < prev    next >
Encoding:
Modula Definition  |  1995-02-22  |  1.9 KB  |  56 lines  |  [TEXT/3PRM]

  1. definition module scrollList;
  2.  
  3.  
  4. //    Version 0.8 to 1.0
  5.  
  6.  
  7. import    deltaIOSystem;
  8. from    ioState import IOState;
  9.  
  10.  
  11. /*    A general Scrolling List definition, which is a dialog item
  12.     implemented entirely in Concurrent Clean as a Control.
  13. */
  14.  
  15.  
  16. ::    NrVisible  :== Int;
  17.  
  18.  
  19. /*    A ScrollingList is defined by the following attributes:
  20.     - Id, ItemPos and SelectState (like other dialog items).
  21.     - The minimum width of the scrolling list (Measure).
  22.       This attribute is important only when ChangeScrollingList is used to
  23.       change the items of the scrolling list. Because the width of dialog
  24.       elements is always fixed a suited minimum width must be chosen in
  25.       which new items defined by ChangeScrollingList will also fit.
  26.       When ChangeScrollingList is never applied a zero minimum width is safe.
  27.     - The number of items that is visible in the list (NrVisible).
  28.     - The item that is initially selected (ItemTitle).
  29.     - The list of items ([ItemTitle]).
  30.     - A DialogFunction that is called whenever a new item is selected.
  31.     The function ScrollingList returns a DialogItem (a Control) that can
  32.     be used in any dialog definition.
  33. */
  34. ScrollingList    ::    !DialogItemId !ItemPos !Measure !SelectState !NrVisible
  35.                     !ItemTitle ![ItemTitle]
  36.                     !(DialogFunction s (IOState s))
  37.                 ->    DialogItem s (IOState s);
  38.  
  39. /*    With ChangeScrollingList the items in the scrolling list can be changed.
  40.     Its arguments are:
  41.     -    the id of the scrolling list,
  42.     -    the new selected item,
  43.     -    and the new list of items.
  44.     When the id is not the id of a ScrollingList a run-time error is
  45.     generated.
  46. */
  47. ChangeScrollingList    ::    !DialogItemId !ItemTitle ![ItemTitle]
  48.                         !(DialogState s (IOState s))
  49.                     ->      DialogState s (IOState s);
  50.  
  51. /*    GetScrollingListItem retrieves the currently selected item in the
  52.     scrolling list with the indicated id from the DialogInfo parameter
  53.     When the id is not the id of a ScrollingList a run-time error occurs.
  54. */
  55. GetScrollingListItem::    !DialogItemId !DialogInfo -> ItemTitle;
  56.